
// 获取文章的数据接口

import request from '@/utils/request.js'



export const Article = (params) => {
    return request({
        method: 'get',
        url: '/v1_0/articles',
        params
    })
}


// 获取所有的频道列表
export const ArticleAll = () => {
    return request({
        method: 'get',
        url:"/v1_0/channels"
    })
}

// 添加我的频道
export const myArticle = channels => {
    return request({
        method: 'patch',
        url: "/v1_0/user/channels",
        data: {
            channels:[channels]
        }
    })
}

// 删除我的频道
export const myDelArticle = id => {
    return request({
        method: 'DELETE',
        url: `/v1_0/user/channels/${id}`,
    })
}


//获取文章详情
export const getArticle = articleId => {
    return request({
        method: 'get',
        url: `/v1_0/articles/${articleId}`,
    })
}